﻿<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@section seo{
    <title>EASESALES開放平台</title>
}
@section script{
    <script>
        $(function () {
            window.categoryId = '@Request.QueryString["categoryId"]';
            setLeftActive();
        });
        function setLeftActive() {
            var cId = parseInt(categoryId)
            if (isNaN(cId)) {
                $('#CategoryList').find('a:eq(0)').addClass('act2');
            } else {
                $('#CategoryList').find('.act2').removeClass('act2');
                $('#CategoryList').find('a[cId="' + cId + '"]').addClass('act2');
            }
        }
    </script>
}
<div class="head_blue_bar">
    <div class="head_src w1170">
        <span>文檔中心 > API </span>
    </div>
</div>
<!--内容-->
<div class="con_box w1170">
    <!--左侧-->
    <div class="con_left left">
        <h3 class="menu_title">所有類別</h3>
        <ul class="menu_1" id="CategoryList">
            @foreach (var category in ViewBag.Categories)
            {
                <li>
                    <a href="@Url.Action("Index","Home",new {Th.ProjectId,categoryId=category.Id})" cId="@category.Id">@category.Name</a>
                </li>
            }
        </ul>
        <div class="clear"></div>
    </div>

    <!--右侧-->
    <div class="con_right right">
        @*<div class="mtl">
                <h2 class="mtl_main">會員API</h2>
                <p class="mtl_desc">提供了用户基本信息查询功能</p>
            </div>*@

        <div class="con_mtl_table">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <thead>
                    <tr>
                        <th width="39%">API列表</th>
                        <th width="10%">類型</th>
                        <th width="45%">描述</th>
                        <th width="6">修改</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (Method method in ViewBag.Methods)
                    {
                        <tr>
                            <td>
                                <a href="@Url.Action("Detail", "Method", new { Th.ProjectId, methodId = method.Id, categoryId = ViewBag.CateogryId })">
                                    @Html.CusRaw(Html.SubStr(method.Name, 20))
                                </a>
                            </td>
                            <td>
                                <span class="red">
                                    @(method.HttpMethod == MethodType.Get ? "Get" : "Post")
                                </span>
                            </td>
                            <td>
                                @{
                                    @Html.SubStr(method.DescriptionIgnorHtml, 20)
                                }
                            </td>
                            <td><a href="@Url.Action("Edit","Method",new{Area="Admin",Th.ProjectId,method.Id})">Edit</a></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>